const {
  DataTypes
} = require('sequelize');
module.exports = sequelize => {
  const attributes = {
    id: {
      type: DataTypes.INTEGER(10).UNSIGNED,
      allowNull: false,
      defaultValue: null,
      primaryKey: true,
      autoIncrement: true,
      comment: "自增id",
      field: "id"
    },
    order_id: {
      type: DataTypes.INTEGER(10).UNSIGNED,
      allowNull: false,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "订单id",
      field: "order_id"
    },
    user_id: {
      type: DataTypes.INTEGER(10).UNSIGNED,
      allowNull: false,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "用户id",
      field: "user_id"
    },
    currency_name: {
      type: DataTypes.CHAR(80),
      allowNull: false,
      defaultValue: "",
      primaryKey: false,
      autoIncrement: false,
      comment: "货币名称",
      field: "currency_name"
    },
    currency_code: {
      type: DataTypes.CHAR(60),
      allowNull: false,
      defaultValue: "",
      primaryKey: false,
      autoIncrement: false,
      comment: "货币代码",
      field: "currency_code"
    },
    currency_symbol: {
      type: DataTypes.CHAR(60),
      allowNull: false,
      defaultValue: "",
      primaryKey: false,
      autoIncrement: false,
      comment: "货币符号",
      field: "currency_symbol"
    },
    currency_rate: {
      type: DataTypes.DECIMAL,
      allowNull: false,
      defaultValue: "0.000000",
      primaryKey: false,
      autoIncrement: false,
      comment: "货币汇率",
      field: "currency_rate"
    },
    add_time: {
      type: DataTypes.INTEGER(10).UNSIGNED,
      allowNull: false,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "添加时间",
      field: "add_time"
    }
  };
  const options = {
    tableName: "sxo_order_currency",
    comment: "",
    indexes: [{
      name: "order_id",
      unique: false,
      type: "BTREE",
      fields: ["order_id"]
    }, {
      name: "user_id",
      unique: false,
      type: "BTREE",
      fields: ["user_id"]
    }, {
      name: "currency_name",
      unique: false,
      type: "BTREE",
      fields: ["currency_name"]
    }, {
      name: "currency_code",
      unique: false,
      type: "BTREE",
      fields: ["currency_code"]
    }, {
      name: "currency_rate",
      unique: false,
      type: "BTREE",
      fields: ["currency_rate"]
    }]
  };
  const SxoOrderCurrencyModel = sequelize.define("sxo_order_currency_model", attributes, options);
  return SxoOrderCurrencyModel;
};